<script setup lang="ts">
  defineProps<{
    title: string;
    content: string;
    expire: string;
    amount: string;
  }>()

  const emits = defineEmits(['click'])
</script>

<template>
  <view class="coupon-card" @click="emits('click')">
    <view class="coupon-info">
      <text class="coupon-title">{{ title }}</text>
      <text class="coupon-content">{{ content }}</text>
    </view>
    <view class="coupon-value">
      <text class="coupon-value-unit">￥</text>
      <text class="coupon-value-amount">{{ amount }}</text>
	  <text class="coupon-expire">过期时间: {{ expire }}</text>
    </view>
  </view>
</template>

<style scoped>
  .coupon-card {
    background-image: url('@/static/owo/coupon-card-bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: -2px -2px;
    height: 80px;
    width: 258px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .coupon-card .coupon-info {
    color: #000000;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    padding-left: 10px;
  }

  .coupon-card  .coupon-info .coupon-content {
    font-weight: 800;
    font-size: 18px;
  }
  .coupon-card .coupon-info .coupon-expire {
    font-size: 9px;
  }

  .coupon-card .coupon-value .coupon-value-unit,
  .coupon-card .coupon-value .coupon-value-amount {
    background: linear-gradient(90deg, #ECA2F5 0%, #2F76EC 100%);
    -webkit-background-clip: text;
    color: transparent;
  }

  .coupon-card .coupon-value {
    padding-right: 16px;
  }
  .coupon-card .coupon-value .coupon-value-unit {
    font-weight: bold;
    font-size: 14px;
  }
  .coupon-card .coupon-value .coupon-value-amount {
    font-weight: medium;
    font-size: 25px;
    font-family: Arial, 'Noto Sans SC';
  }
</style>
